package com.guagua.chat.sns;
/**
 * 北京八度互联科技有限公司版权所有
 * Copyright (C) Badu Corporation. All Rights Reserved
 */
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;

import com.guagua.base.database.ConnectionManager;
import com.guagua.chat.base.BaseDao;
import com.guagua.chat.post.PostInfo;
public class SnsDao extends BaseDao{
 
	public Long guagua(){
		Connection con = null;
		PreparedStatement pstmt = null;
		ResultSet rs = null;
		try{
			//getDataSourceConnection用户获取resin中的连接池
			con = ConnectionManager.getDataSourceConnection(JNDI_NAME);
			String selectSQL ="select count(*) as counts from t_active_center";
			pstmt = con.prepareStatement(selectSQL);
			rs =pstmt.executeQuery();
			while(rs.next()){
				 
				return rs.getLong("counts");
			}
			return  0L;
		}catch(Exception sqle){
			return  0L;
		}finally{
			ConnectionManager.close(rs,pstmt, con);
		}
	}
	public Long sns(){
		Connection con = null;
		PreparedStatement pstmt = null;
		ResultSet rs = null;
		try{
			//getConnection用户获取pool_badu中的连接池
			con = ConnectionManager.getConnection(POOL_SNS);
			String selectSQL ="select count(*) as counts from tiezi";
			pstmt = con.prepareStatement(selectSQL);
			rs =pstmt.executeQuery();
			while(rs.next()){
				 
				return rs.getLong("counts");
			}
			return  0L;
		}catch(Exception e){
			e.printStackTrace();
			return  0L;
		}finally{
			ConnectionManager.close(rs,pstmt, con);
		}
	}
}
